package org.javanum.number;

/**
 * <p>Represents a Subfield in an abstract {@link Field}.</p>
 * 
 * <p>Note that this interface specifies the basic behavior of a 
 * subfield--namely that elements in a subfield can be treated either
 * as elements in the subfield or as elements in the superfield itself. Thus,
 * this interface overloads the basic Field operations to accept element
 * either from the subfield or from the field itself.</p>
 * 
 * @author Scott Fines
 * Date: Oct 31, 2009
 *
 * @param <V> the return type of subfield operations
 * @param <T> the return type of the larger field operations
 */
public interface SubField<V extends SubField<V,T>,T extends Field<T>>
                            extends Field<T>, SubRing<V, T> {
	
	/**
	 * 
	 * @param divisor the element to be divided by
	 * @return the result of the computation {@code this/divisor}
	 * @throws ArithmeticException if {@code divisor=} 
	 * {@link #additiveIdentityAsSubElement()}
	 * @see {@link #divide(Field)}
	 */
	public V divide(V divisor);
	
	/**
	 * @return the multiplicative identity as an implementation of
	 * this interface
	 * @see {@link #multiplicativeIdentity()}
	 */
	public V multiplicativeIdentityAsSubElement();
	
	/**
	 * @return the multiplicative inverse of {@code this} as an 
	 * implementation of this interface. 
	 * @see {@link #multiplicativeIdentity()}
	 */
	public V multiplicativeInverseAsSubElement();

}
